<?php
	$data = array();
	$data['title'] = "Tìm kiếm hóa đơn nhập";
	$data['template'] = "report/search_costs";
	if(isset($_POST['ok'])){
		$db = new Model_order;
		$pager = new libraries_pager;
		$from = $_POST['from_date'];
		$to   = $_POST['to_date'];
		$data['from'] = $_POST['from_date'];
		$data['to'] = $_POST['to_date'];
		$limit = 30;
		$pager->set_link("index.php?mod=menu&act=search");
		$total = $db->search_total_order2($from,$to);
		$start = $pager->start();
		$pages = $pager->page($total,$limit);
		$data['pagelist'] = $pager->listpage($pages,$start,$limit);
		$data['list'] = $db->search_list_order2($from,$to,$start,$limit);
		loadview("layout",$data);
	}else{
		loadview("layout",$data);
	}
	
?>